package com.chinasofti.shoot;


import java.util.Random;

//敌机即是飞行物也是敌人
public class AirePane extends FlyingObject implements  Enemy {

    private int sped = 2; //走步的步数
    @Override
    public int getScore() {
        return 5;
    }

    public  AirePane(){
        imge=ShootGame.airplane;
        width = imge.getWidth();
        height = imge.getHeight();
        Random random = new Random();
        x=random.nextInt(ShootGame.WIDTH-this.width);//随机的x坐标
        y=-this.height;//随机的y坐标

    }

    @Override
    public void step() {
        y+=sped;//y向下 走
    }

    @Override
    public boolean outOfBounds() {
        return this.y>ShootGame.HEIGHT;
    }
}